package data.join.com.http;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import data.join.com.database.bean.ImageBean;
import data.join.com.utils.MyDate;

/**
 * Created by Administrator on 2016/7/1.
 */
public class GetImage {

    class ImageHttp{
        public long imageId;
        public String srcPath;
        public String thumbnail;
        public long time;
        public long fileSize;
        public String date;

        public ImageHttp(ImageBean image){
            imageId = image.id;
            srcPath = image.srcPath;
            thumbnail = image.thumbnail;
            time = image.time;

            File f = new File(image.srcPath);

            if(f.exists()){
                fileSize = f.length();
            }else{
                fileSize = 0;
            }

            date = MyDate.getFormatDateByLong(image.time);
        }

    }

    public List<ImageHttp> imageList;
    public int count;
    public int limit;
    public int offset;

    public GetImage(){
        imageList = new ArrayList<ImageHttp>();
    }

    public void setImageList(List<ImageBean> list){
        for(ImageBean image:list){
            ImageHttp info = new ImageHttp(image);
            imageList.add(info);
        }
    }
}
